package com.wealth.system.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.shiro.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/** 
 * 登出
 * @author CHAN
 */
@Controller
@RequestMapping(value="/logout")

public class LogoutController extends BaseController {
	
	Logger logger = LoggerFactory.getLogger(LogoutController.class);

	/**
	 * 登出
	 */
	@RequestMapping
	public String loginout(HttpServletRequest request, HttpServletResponse response){
		try {
			/**
			 * shiro 退出登录
			 */
			SecurityUtils.getSubject().logout();

			return "redirect:/login";
		} catch (Exception e) {
			logger.error(" 登出时报错", e);
			return "system/500";
		}
	} 
}
